package com.serviceprovider.business.module.admin.provider.model;

//~--- non-JDK imports --------------------------------------------------------

import com.thoughtworks.xstream.annotations.XStreamAlias;

@XStreamAlias("zipInfo")
public class ZipInfo {
    private String city;
    private String conty;
    private int    id;
    private String state;
    private String zipCode;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
        System.out.println();
    }

    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String zipCode) {
        this.zipCode = zipCode;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getConty() {
        return conty;
    }

    public void setConty(String conty) {
        this.conty = conty;
    }

    @Override
    public boolean equals(Object obj) {
        if ((obj == null) ||!(obj instanceof ZipInfo)) {
            return false;
        }

        ZipInfo b  = (ZipInfo) obj;
        boolean eq = (id == b.id);

        if (!eq) {
            return false;
        }

        eq = ((zipCode == null) && (b.zipCode == null)) || ((zipCode != null) && zipCode.equals(b.zipCode));

        if (!eq) {
            return false;
        }

        eq = ((state == null) && (b.state == null)) || ((state != null) && state.equals(b.state));

        if (!eq) {
            return false;
        }

        eq = ((city == null) && (b.city == null)) || ((city != null) && city.equals(b.city));

        if (!eq) {
            return false;
        }

        eq = ((conty == null) && (b.conty == null)) || ((conty != null) && conty.equals(b.conty));

        if (!eq) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int prime  = 31;
        int result = 1;

        result = prime * result + id;
        result = prime * result + ((zipCode == null)
                                   ? 0
                                   : zipCode.hashCode());
        result = prime * result + ((state == null)
                                   ? 0
                                   : state.hashCode());
        result = prime * result + ((city == null)
                                   ? 0
                                   : city.hashCode());
        result = prime * result + ((conty == null)
                                   ? 0
                                   : conty.hashCode());

        return result;
    }
}



